package edu.iu.criminfo.voronoi.init;

import java.util.ArrayList;
import java.util.List;

import edu.iu.criminfo.voronoi.cases.Case;
import edu.iu.criminfo.voronoi.kmeans.Cluster;
import edu.iu.criminfo.voronoi.object.Point;

public class InitiateCluster {
	public static List<Cluster> generateInitiateCluster(List<Case> caseList,
			double swCornerX, double swCornerY, double neCornerX,
			double neCornerY) {
		List<Cluster> clusterList = new ArrayList<Cluster>();

		double stepX = (neCornerX - swCornerX) / 4;
		double stepY = (neCornerY - swCornerY) / 4;
		double initX = swCornerX + stepX / 2;
		double initY = swCornerY + stepY / 2;

		for (int i = 0; i <= 3; i++) {
			for (int j = 0; j <= 3; j++) {
				clusterList.add(new Cluster(new Point(initX + i * stepX, initY
						+ j * stepY)));
			}
		}

		return clusterList;
	}
}
